using System;
using UnityEngine;
using UnityEngine.UI;

public enum EPanelType
{
    None,
    Hall,
    Module,
    Window,
    Front,
}

public abstract class PanelBase : MonoBehaviour
{
    public EPanelType m_PanelType = EPanelType.None;
    private Button _closeButton;
    
    void Start()
    {
        Init();
    }

    protected virtual void Init()
    {
        Debug.Log($"当前界面的名称是{this.name}");
        UIManager.m_Instance.RegisterPanel(this.name, this);
        // _closeButton = transform.Find("btn_close").GetComponent<Button>();
        // _closeButton.onClick.AddListener(ClosePanel);
    }

    public void OpenPanel()
    {
        gameObject.SetActive(true);
    }

    public virtual void OpenPanel(Action pAction)
    {
        
    }

    public void ClosePanel()
    {
        gameObject.SetActive(false);
    }
}
